//
//  MainCViewCell.m
//  Travel_M_Travel
//
//  Created by Sun on 15/3/23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Type_3CViewCell.h"
#import "AboutDataData.h"
#import "AboutElemData.h"
#import "HFCollectionRView.h"
#import "UIImageView+WebCache.h"
#import "UIColor+AddColor.h"

@implementation Type_3CViewCell

- (void)dealloc
{
    [_imageView release];
    [_name release];
    [_aboutData3 release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 定义cell单元格内容
        _imageView = [[UIImageView alloc] init];
        _imageView.clipsToBounds = YES;
        _imageView.layer.cornerRadius = 5;
        [self addSubview:_imageView];
        [_imageView release];
        
        self.name = [[UILabel alloc] init];
        _name.textColor = [UIColor whiteColor];
        _name.font = [UIFont boldSystemFontOfSize:12];
        [_imageView addSubview:_name];
        [_name release];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _imageView.frame = CGRectMake(0, 0, 135, 135);
    _name.frame = CGRectMake(0, 100, self.frame.size.width - 20, 35);
    _name.textAlignment = NSTextAlignmentRight;
}

- (void)setAboutData3:(AboutDataData *)aboutData3
{
    if (_aboutData3 != aboutData3) {
        [_aboutData3 release];
        _aboutData3 = [aboutData3 retain];
    }
    NSString *str = self.aboutData3.photo;
    str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *url = [NSURL URLWithString:str];
    [_imageView setImageWithURL:url];
    
    
    _name.text = [self.aboutData3.poi objectForKey:@"name"];
    NSLog(@"图片!!!!!!!!!!!!%@", str);
    
    

}




@end



